package baidu.bms.filter;

import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScans;
import org.springframework.context.annotation.Configuration;

/**
 * @author sunqiyuan
 * @Classname autoconfig
 * @Description TODO
 * @Date 2020/10/16 2:33 下午
 * @Version V1.0
 */
@Configuration
@EnableConfigurationProperties(HttpFilterProperties.class)
public class Autoconfig {
    @Bean
    public FilterRegistrationBean someFilterRegistration() {

        FilterRegistrationBean registration = new FilterRegistrationBean();

        registration.setFilter(new HttpFilter());
//        registration.addUrlPatterns("/url/*");
//        registration.addInitParameter("paramName", "paramValue");
//        registration.setName("someFilter");
//        registration.setOrder(1);
        registration.setName("dubbohttpFilter");
        return registration;
    }

}
